package com.nanhai.buddhist.college.module.study.dal.mysql.studyevaluationitem;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.study.dal.dataobject.studyevaluationitem.StudyEvaluationItemDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.study.controller.admin.studyevaluationitem.vo.*;

/**
 * 评价项目 Mapper
 *
 * @author 南海佛学院
 */
@Mapper
public interface StudyEvaluationItemMapper extends BaseMapperX<StudyEvaluationItemDO> {

    default PageResult<StudyEvaluationItemDO> selectPage(StudyEvaluationItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudyEvaluationItemDO>()
                .likeIfPresent(StudyEvaluationItemDO::getEvaluationItem, reqVO.getEvaluationItem())
                .eqIfPresent(StudyEvaluationItemDO::getEvaluationText, reqVO.getEvaluationText())
                .eqIfPresent(StudyEvaluationItemDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(StudyEvaluationItemDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(StudyEvaluationItemDO::getOrgId, reqVO.getOrgId())
                .orderByDesc(StudyEvaluationItemDO::getId));
    }

    default List<StudyEvaluationItemDO> selectList(StudyEvaluationItemExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<StudyEvaluationItemDO>()
                .likeIfPresent(StudyEvaluationItemDO::getEvaluationItem, reqVO.getEvaluationItem())
                .eqIfPresent(StudyEvaluationItemDO::getEvaluationText, reqVO.getEvaluationText())
                .eqIfPresent(StudyEvaluationItemDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(StudyEvaluationItemDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(StudyEvaluationItemDO::getOrgId, reqVO.getOrgId())
                .orderByDesc(StudyEvaluationItemDO::getId));
    }

}
